package xyz.yudan.app.index;

/**
 * Created by gamy on 2018/4/6.
 */
final public class UserTeamIndex extends BaseIndex {

    final public class TeamRole {
        public final static int NONE = 0; //创建人
        public final static int APPLICANT = 1; //申请加入
        public final static int MEMBER = 2; //普通成员
        public final static int MANAGER = 3; //管理者
        public final static int CREATOR = 4; //创建人
    }

    private String userId = "";
    private String teamId = "";
    private String inviter = "";
    private String info = "";
    private int createTime;
    private int role = TeamRole.NONE;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getTeamId() {
        return teamId;
    }

    public void setTeamId(String teamId) {
        this.teamId = teamId;
    }

    public String getInviter() {
        return inviter;
    }

    public void setInviter(String inviter) {
        this.inviter = inviter;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public int getCreateTime() {
        return createTime;
    }

    public void setCreateTime(int createTime) {
        this.createTime = createTime;
    }

    public int getRole() {
        return role;
    }

    public void setRole(int role) {
        this.role = role;
    }

    public boolean save() {
        return false;
    }

    public boolean delete() {
        return false;
    }

    //获取索引
    public static UserTeamIndex getIndex(String userId, String teamId) {
        return null;
    }

    //创建索引
    public static UserTeamIndex createIndex(String userId, String teamId) {
        return null;
    }

    //创建索引
    public static int getRole(String userId, String teamId) {
        UserTeamIndex index = getIndex(userId, teamId);
        if (index != null) {
            return index.getRole();
        }
        return TeamRole.NONE;
    }
}
